package com.shilei.spring;

import com.shilei.spring.util.AopUtil;
import com.shilei.spring.util.BeanUtil;

/**
 * @author 石雷
 * shilei1@jiayuan.com
 * 2021/9/1/001 11:19
 */
public class Application {
    public static void run(String pack){
        {
            //1.模拟包扫描 初始化bean
            BeanUtil.initBeans(pack);
            BeanUtil.getValues(pack);

            //2.动态代理实现aop**初始化bean 开始**
            AopUtil.initProxy(pack);

            //3.模拟di注入 @value注解 注入值
            BeanUtil.DI(pack);


        }
    }

    public static void main(String[] args) {
        //初始化
        Application.run("com.shilei.spring");

        //5.测试aop
        Test bean = BeanUtil.getBean(Test.class);
        bean.test();
    }
}
